<?php

namespace App\Models\Asset;

use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class posterHref
 * @package App\Models\Asset
 * @version August 31, 2018, 10:53 pm CST
 *
 * @property \App\Models\Asset\Poster poster
 * @property \App\Models\Asset\Imgtpl imgtpl
 * @property string posterId
 * @property integer imgtpl_id
 * @property string path
 * @property string storage
 */
class posterHref extends Model
{
    use SoftDeletes;


    public $table = 'poster_hrefs';
    

    protected $dates = ['deleted_at'];


    public $fillable = [
        'posterId',
        'imgtpl_id',
        'path',
        'storage'
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'posterId' => 'string',
        'imgtpl_id' => 'integer',
        'path' => 'string',
        'storage' => 'string'
    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     **/
    public function poster()
    {
        return $this->hasOne(\App\Models\Asset\Poster::class, 'posterId', 'posterId');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     **/
    public function imgtpl()
    {
        return $this->hasOne(\App\Models\Common\CatData\Image\Imgtpl::class, 'id', 'imgtpl_id');
    }
}
